package config

import (
	"errors"
	"fmt"
	"gitee.com/golang-samples/iniConfig"
	"io/ioutil"
)

func InitConfig() error {
	data, err := ioutil.ReadFile("./config.ini")
	if err != nil {
		return errors.New("open file error")
	}
	err = iniconfig.UnMarshal(data, &ConfigModle)
	if err != nil {
		return fmt.Errorf("file UnMarshal error:%v", err)
	}
	return nil
}
